<div class="col-md-6 col-md-offset-3">
    <form method="POST" action="{{ script_root }}/admin/chal/new" enctype="multipart/form-data">
        <div class="form-group">
            <label for="name">Name
                <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="The name of your challenge"></i>
            </label>
            <input type="text" class="form-control" name="name" placeholder="Enter challenge name">
        </div>
        <div class="form-group">
            <label for="category">Category
                <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="The category of your challenge"></i>
            </label>
            <input type="text" class="form-control" name="category" placeholder="Enter challenge category">
        </div>

        <ul class="nav nav-tabs" role="tablist" id="new-desc-edit">
            <li role="presentation" class="active"><a href="#new-desc-write" aria-controls="home" role="tab" data-toggle="tab">Write</a></li>
            <li role="presentation"><a href="#new-desc-preview" aria-controls="home" role="tab" data-toggle="tab">Preview</a></li>
        </ul>
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="new-desc-write">
                <div class="form-group">
                    <label for="message-text" class="control-label">Message:
                        <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="Use this to give a brief introduction to your challenge. The description supports HTML and Markdown."></i>
                    </label>
                    <textarea id="new-desc-editor" class="form-control" name="desc" rows="10"></textarea>
                </div>
            </div>
            <div role="tabpanel" class="tab-pane content" id="new-desc-preview" style="height:234px; overflow-y: scroll;">
            </div>
        </div>

        <!-- ADDED BY ME: -->
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="new-solidity-write">
                <div class="form-group">
                    <label for="solidity" class="control-label">Solidity Source:
                        <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="Paste the solidity source for the contract here."></i>
                    </label>
                    <textarea id="new-solidity-editor" class="form-control" name="solidity" rows="10" required></textarea>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="new-test-func-write">
                <div class="form-group">
                    <label for="test_func" class="control-label">Test Expression (Python):
                        <i class="fa fa-question-circle gray-text"
                        data-toggle="tooltip" data-placement="right" title="Paste a one line expression to test the contract here. You have access to your contract as a web3 contract called 'contract'"></i>
                    </label>
                    <input id="new-test-func-editor" class="form-control" name="test_func" placeholder="contract.call().myFunction() == 4 and contract.call().getUserBalance < 0" rows="10" required></input>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="new-args-write">
                <div class="form-group">
                    <label for="args" class="control-label">Starting Arguments (Python List):
                        <i class="fa fa-question-circle gray-text"
                        data-toggle="tooltip" data-placement="right" title="Paste a python list that contains the arguments to the contract. Default:[]"></i>
                    </label>
                    <input id="new-args-editor" class="form-control" name="args" rows="10" value="[]" required></input>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="starting-ether">Starting Ether
                <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="This is how much ether the smart contract should be preloaded with. The constructor must be payable."></i>
            </label>
            <input type="number" class="form-control" name="starting-ether" placeholder="Enter starting ether" required>
        </div>

        <!-- END ADDED BY ME -->

        <div class="form-group">
            <label for="value">Value
                <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="This is how many points are rewarded for solving this challenge."></i>
            </label>
            <input type="number" class="form-control" name="value" placeholder="Enter value" required>
        </div>
        <div class="row">
            <div class="form-group">
                <div class="col-md-8">
                    <label for="key">Key
                        <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="This is the flag/solution for the challenge."></i>
                    </label>
                    <input type="text" class="form-control" name="key" placeholder="Enter key">
                </div>
                <div class="form-vertical">
                    <div class="col-md-2">
                        <div class="radio">
                            <label>
                                <input type="radio" name="key_type[0]" value="0" checked>
                                Static
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="key_type[0]" value="1">
                                Regex
                            </label>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="form-group">
                <div class="col-md-9">
                    <div class="checkbox">
                        <label>
                            <input name="hidden" type="checkbox">
                            Hide challenge on creation
                        </label>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="checkbox">
                <label>
                    <input type="checkbox" id="solve-attempts-checkbox">
                    Limit amount of solve attempts
                </label>
            </div>
            <div id="solve-attempts-input" style="display: none;">
                <label for="max_attempts">Maximum Attempts
                    <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="How many attempts should a user have for this challenge? For unlimited attempts, use the value 0"></i>
                </label>
                <input class="form-control" id='max_attempts' name='max_attempts' type='number' placeholder="0">
            </div>
        </div>

        <div class="row">
            <div class="form-group">
                <div class="col-md-9">
                    <label>Upload Challenge Files
                        <i class="fa fa-question-circle gray-text" data-toggle="tooltip" data-placement="right" title="Challenges files are provided to users for download alongside your challenge description"></i>
                    </label>
                    <sub class="help-block">Attach multiple files using Control+Click or Cmd+Click.</sub>
                    <input type="file" name="files[]" multiple="multiple">
                </div>
            </div>
        </div>
        <input type="hidden" value="{{ nonce }}" name="nonce" id="nonce">
        <input type="hidden" value="ethereum" name="chaltype" id="chaltype">
        <div style="text-align:center">
            <button class="btn btn-theme btn-outlined create-challenge-submit" type="submit">Create</button>
        </div>
    </form>
</div>
